import { createRouter, createWebHistory } from 'vue-router'
import Layout from "../layout/Layout";


const routes = [
    {
        path: '/login',
        component: () => import('@/views/login/index'),
        hidden: true
    }, {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: '/home',
        children:[
        {
            path:'/home',
            name:'首页',
            component: () => import('@/views/Home')
        },{
            path:'/data',
            name:'营销管理',
            component: () => import('@/views/data/SalesManager')
        },{
           path:'/salesAdd',
           name:'添加销售',
           component:() => import('@/views/data/SalesAdd')
         },{
            path:'/goodsManager',
                name:'仓库管理',
                component: () => import('@/views/product/GoodsManager')
          }
         , {
                path:'/userManager',
                name:'user',
                component: () => import('@/views/user/UserManager')
            }
        /* ,{
            path:'/goodsDetail',
            name:'详情',
            component:() => import('@/views/product/GoodsDetail')
            }*/
         ,{
                path:'/goodsEdit',
                name:'详情',
                component:() => import('@/views/product/GoodsEdit')
            }
         ,{
            path:'/DataManager',
            name:'DataManager',
            component: ()=> import('@/views/data/DataManager')
         },{
            path:'/UserEditAndDetail',
            name:'编辑和详情页',
            component: ()=> import('@/views/data/UserEditAndDetail')
         }
         ,{
                path:'/ImgManager',
                name:'编辑和详情页',
                component: ()=> import('@/views/openCv/ImgManager')
         }
        ]
    }, {
        path:'/register',
        component:() => import('@/views/login/register'),
    }
    ]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
